package com.nenmei.source.controller;

import com.nenmei.source.bean.Car;
import com.nenmei.source.bean.Person;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @date: 2021/08/06
 * @time: 21:49
 * @author: yuyifan
 */

@Slf4j
@RestController
public class HelloController {

    @Autowired
    Car car;

    @Autowired
    Person person;

    @RequestMapping("/testCar")
    public Car testCar() {
        return car;
    }

    @RequestMapping("/hello")
    public String handle01(@RequestParam(value = "name") String username) {
        log.info("请求已经进来啦---");
        return "Hello, Spring Boot 2"+"宝贝我想要你,让我进来, "+username;
    }

    @RequestMapping("/person")
    public Person person() {
        return person;
    }
}


